package cn.taobaoke.restful.config

import org.springframework.boot.web.embedded.undertow.UndertowBuilderCustomizer
import org.springframework.boot.web.embedded.undertow.UndertowServletWebServerFactory
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration

@Configuration
class HttpConfig {

    @Bean
    fun undertowServletWebServerFactory(): UndertowServletWebServerFactory {
        val factory = UndertowServletWebServerFactory();
        factory.addBuilderCustomizers(UndertowBuilderCustomizer {
            it -> it?.addHttpListener(8080, "0.0.0.0")
//            it -> it?.addHttpListener(8080, "0.0.0.0")
        })
        return factory
    }
}